/**
 * @file es_assert.h
 *
 * @brief Implementing customized assertions.
 *
 * @author bagy
 *
 * @version V1.0
 *
 * @date 2024-05-14
 *
 */

#ifndef __ES_ASSERT_H__
#define __ES_ASSERT_H__

#include "es_cstand.h"

#ifdef NDEBUG
    #define ES_ASSERT(cond) ((void)0)
#else
    #define ES_ASSERT(cond) 																											\
        do { 																															\
            	if (!(cond)) { 																											\
            		fprintf(stderr, "Assertion failed: (%s), function %s, file %s, line %d.\n", #cond, __func__, __FILE__, __LINE__); 	\
            		abort(); 																											\
            	} 																														\
        	} while (0)
#endif

#endif /* __ES_ASSERT_H__ */
